package top.shiyiri.diamondoperator;

import org.junit.Test;

import java.util.Comparator;

/**
 * @author Aunean
 * @date 2022/1/15 21:28
 */
public class OperatorTest {
    /*
    Java9 新特性：钻石操作符的升级
     */
    @Test
    public void test1() {
        //Java8：new Comparator<Object>()
        //Java9：new Comparator<>()
        Comparator<Object> comparator = new Comparator<>() {
            @Override
            public int compare(Object o1, Object o2) {
                return 0;
            }
        };
    }
}
